<div>
	<hr>
	<ul class="breadcrumb">
		<li>
			<a href="<?php echo Yii::app()->createUrl('site/index'); ?>">Trang chủ</a> <span class="divider">/</span>
		</li>
		<li>
			<a href="#">Quản lý quảng cáo</a>
		</li>
	</ul>
	<hr>
</div>
<div class="row-fluid sortable">		
	<div class="box span12">
		<div class="box-header" data-original-title>
			<h2><i class="icon-tags"></i><span class="break"></span><i class="icon-plus"></i><a href="<?php echo Yii::app()->createUrl('advertisement/create'); ?>"> Tạo quảng cáo</a></h2>
			<div class="box-icon">
				<a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
				<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
				<a href="#" class="btn-close"><i class="icon-remove"></i></a>
			</div>
		</div>
		<div class="box-content">
			<table class="table table-striped table-bordered bootstrap-datatable datatable">
				<thead>
					<tr>
						<th> Tên quảng cáo</th>
						<th> Người tạo</th>
						<th> Trạng thái</th>
						<th> Loại ưu tiên </th>
						<th> Hành động </th>
					</tr>
				</thead>   
				<tbody>
					<?php foreach($dataProvider as $value) : ?>
					<tr>
						<td><?php echo $value['name']; ?></td>
						<td class="center"><?php echo $value['user']['name'] ?></td>
						<td class="center">
							<?php if($value['status'] == 1) :?>
								<span class="label label-success"> Xuất hiện</span>
							<?php else : ?>
								<span class="label"> Không xuất hiện</span>
							<?php endif;?>
						</td>
						<td class="center"><?php echo $value['level'];?></td>
						<td class="center">
							<a title="Chỉnh sửa thông tin" class="btn btn-info" href="<?php echo $this->createUrl('advertisement/update',array('id' => $value['id'])); ?>">
								<i class="icon-edit icon-white"></i> 
							</a>
							<?php if($value['status'] == 1) :?>
								<a title="Không kích hoạt" class="btn btn-warning" href="<?php echo $this->createUrl('advertisement/deactive',array('id' => $value['id'])); ?>">
									<i class="icon-refresh icon-white"></i> 
								</a>
							<?php else : ?>
								<a title="Kích hoạt" class="btn btn-success" href="<?php echo $this->createUrl('advertisement/active',array('id' => $value['id'])); ?>">
									<i class="icon-refresh icon-white"></i> 
								</a>
							<?php endif; ?>
							<a title="Xóa quảng cáo" class="btn btn-danger" href="<?php echo $this->createUrl('advertisement/delete',array('id' => $value['id'])); ?>">
								<i class="icon-trash icon-white"></i> 
							</a>
							
						</td>
					</tr>
				<?php endforeach; ?>
			</tbody>
		</table>            
	</div>
</div>
<!-- </div> --> <!--  --><!--/row -->

